import { request, config } from 'utils'

const { api } = config
const { noticesList, noticesListAll, noticesAdd, noticesEdit, noticesQuery, noticesDel, noticesMultiDel, noticesUnread, privateNoticesList } = api

export async function list (params) {
  return request({
    url: noticesList,
    method: 'post',
    data: params,
  })
}
export async function privatelist (params) {
  return request({
    url: privateNoticesList,
    method: 'post',
    data: params,
  })
}

export async function listall (params) {
  return request({
    url: noticesListAll,
    method: 'post',
    data: params,
  })
}

export async function query (params) {
  return request({
    url: noticesQuery,
    method: 'put',
    data: params,
  })
}


export async function create (params) {
  return request({
    url: noticesAdd,
    method: 'post',
    data: params,
  })
}

export async function update (params) {
  return request({
    url: noticesEdit,
    method: 'put',
    data: params,
  })
}
export async function remove (params) {
  return request({
    url: noticesDel,
    method: 'delete',
    data: params,
  })
}

export async function patchremove (params) {
  return request({
    url: noticesMultiDel,
    method: 'delete',
    data: params,
  })
}

export async function noticesUser (params) {
  return request({
    url: noticesUser,
    method: 'get',
    data: params,
  })
}

export async function Unread (params) {
  return request({
    url: noticesUnread,
    method: 'get',
    data: params,
  })
}


